/ Assembly List / LJCNetCommon / AppSettings / GetString

Namespace - LJCNetCommon


Parameters
keyName - The setting key name.
allowMissingValue - Indicates if a missing value throws an exception.

Returns

The string setting value.

Syntax

C#
public String GetString(String keyName, Boolean allowMissingValue = True)

Get the string value of the specified setting. (E)

Example

C#
// App.Config file.
// <configuration>
//   <appSettings>
//     <add key="DataConfigName" value="AppTables" />
//   </appSettings>
// </configuration>

using LJCNetCommon;

var appSettings = new AppSettings("AppName.exe.config");
string dataConfigName = appSettings.GetString("DataConfigName");

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.